﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Data.Tables
{
    #region Payroll

    [Table("Payroll")]
    public class Payroll : PayrollFields
    { }

    public class PayrollQueryModel : PayrollFields
    {
        public string WorkLocationName { get; set; }

        public bool HasDetails { get; set; }
    }

    public class PayrollFields
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        [Display(Name = "ID")]
        public int ID { get; set; }

        [Display(Name = "Work Location")]
        public int WorkLocationID { get; set; }

        [Required]
        [Display(Name = "Cut-Off Start Date")]
        public DateTime CutOffStartDate { get; set; }

        [Required]
        [Display(Name = "Cut-Off End Date")]
        public DateTime CutOffEndDate { get; set; }

        [Required]
        [Display(Name = "Processed By")]
        public string ProcessedBy { get; set; }

        [Required]
        [Display(Name = "Date Processed")]
        public DateTime DateProcessed { get; set; }
    }

    #endregion

    #region Payroll Details

    [Table("PayrollDetail")]
    public class PayrollDetail : PayrollDetailFields
    { }

    public class PayrollDetailQueryModel : PayrollDetailFields
    {
        [Display(Name = "Employee Name")]
        public string EmployeeName { get; set; }

        [Display(Name = "Employment Type")]
        public string EmploymentType { get; set; }

        [Display(Name = "Rate Type")]
        public string RateType { get; set; }
    }

    public class PayrollDetailFields
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        [Display(Name = "ID")]
        public int ID { get; set; }

        [Display(Name = "Payroll ID")]
        public int PayrollID { get; set; }

        [Display(Name = "Employee Code")]
        public string EmployeeCode { get; set; }

        [Display(Name = "Employee Contract ID")]
        public int EmployeeContractID { get; set; }

        [Display(Name = "Employment Type")]
        public int EmploymentTypeID { get; set; }

        [Display(Name = "Rate Type")]
        public int RateTypeID { get; set; }

        [Display(Name = "Hourly Rate")]
        public decimal HourlyRate { get; set; }

        [Display(Name = "Daily Rate")]
        public decimal DailyRate { get; set; }

        [Display(Name = "Monthly Rate")]
        public decimal MonthlyRate { get; set; }

        [Display(Name = "Regular Work Hours")]
        public decimal RegularWorkHours { get; set; }

        [Display(Name = "Over Time Hours")]
        public decimal OverTimeHours { get; set; }

        [Display(Name = "Night Differential Hours")]
        public decimal NightDifferentialHours { get; set; }

        [Display(Name = "Regular Holiday Hours")]
        public decimal RegularHolidayHours { get; set; }

        [Display(Name = "Regular Holiday Pay")]
        public decimal RegularHolidayPay { get; set; }

        [Display(Name = "Special Non-Working Day Hours")]
        public decimal SpecialNonWorkingDayHours { get; set; }

        [Display(Name = "Special Non-Working Day Pay")]
        public decimal SpecialNonWorkingDayPay { get; set; }

        [Display(Name = "Gross Pay")]
        public decimal GrossPay { get; set; }

        [Display(Name = "With Holding Tax")]
        public decimal WithHoldingTax { get; set; }

        [Display(Name = "SSS Contribution")]
        public decimal SSSContribution { get; set; }

        [Display(Name = "Pag Ibig Fund")]
        public decimal PagIbigFund { get; set; }

        [Display(Name = "Phil Health")]
        public decimal PhilHealth { get; set; }

        [Display(Name = "Other Deductions")]
        public decimal OtherDeductions { get; set; }

        [Display(Name = "Other Deductions Remarks")]
        public string OtherDeductionsRemarks { get; set; }
        
        [Display(Name = "Other Additions")]
        public decimal OtherAdditions { get; set; }

        [Display(Name = "Other Additions Remarks")]
        public string OtherAdditionsRemarks { get; set; }

        [Display(Name = "Net Pay")]
        public decimal NetPay { get; set; }

    }

    #endregion
}